import React from 'react'
import ReactEcharts from "echarts-for-react";
export default function index(props) {
    let option = {
        tooltip: {
            trigger: 'item'
        },
        xAxis: {
            type: 'category',
            data: props.X_data,
            ...props.X_other,
        },

        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: props.S_data,
                type: 'bar',
                itemStyle: {
                        borderRadius: [5, 5, 0, 0]
                },
            }
        ]
    };
    return <ReactEcharts style={{ height: props.height }} option={option} />
}
// 设置默认 props
index.defaultProps = {
    height: '500px',
    X_data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    X_other: {},
    S_data: [120, 200, 150, 80, 70, 110, 130],
};